package com.google.code.swingonfire.component.clock;

public enum JClockHandType
{
    YEAR(9999, 10, 1, 0, true, true, true, true, true, true, true, true),
    MONTH(12, 12, 1, 0, true, true, true, true, true, true, true, true),
    DAY(31, 31, 1, 0, true, true, true, true, true, true, true, true),
    SUN(1, 1, 1d / 24 / 60, 0, true, true, true, true, true, true, true, true),
    AMPM(2, 2, 1, 0.5, true, true, true, true, true, true, true, true),
    HOUR(12, 12, 1d / 60, 0, true, true, true, true, true, false, true, true),
    MINUTE(60, 60, 1, 0, true, true, true, true, true, true, false, true),
    SECOND(60, 60, 1, 0, true, true, true, true, true, true, true, false);

    private final double maximum;
    private final double maximumChangePerSecond;
    private final double roundToNearest;
    private final double roundOffset;
    private final double tickDistance;
    private final double lockDistance;

    private final boolean animateYearOnAdjusting;
    private final boolean animateMonthOnAdjusting;
    private final boolean animateDayOnAdjusting;

    private final boolean animateSunOnAdjusting;
    private final boolean animateAMPMOnAdjusting;

    private final boolean animateHourOnAdjusting;
    private final boolean animateMinuteOnAdjusting;
    private final boolean animateSecondOnAdjusting;

    /**
     * Creates a new hand type.
     * 
     * @param maximum the maximum value
     * @param maximumChangePerSecond how much the value can change at maximum per second
     * @param roundToNearest the common rounding for a value (like the ticks)
     * @param roundOffset the offset for the rounding
     * @param animateYearOnAdjusting true if adjustment should be animated
     * @param animateMonthOnAdjusting true if adjustment should be animated
     * @param animateDayOnAdjusting true if adjustment should be animated
     * @param animateSunOnAdjusting true if adjustment should be animated
     * @param animateAMPMOnAdjusting true if adjustment should be animated
     * @param animateHourOnAdjusting true if adjustment should be animated
     * @param animateMinuteOnAdjusting true if adjustment should be animated
     * @param animateSecondOnAdjusting true if adjustment should be animated
     */
    private JClockHandType(double maximum, double maximumChangePerSecond, double roundToNearest, double roundOffset,
        boolean animateYearOnAdjusting, boolean animateMonthOnAdjusting, boolean animateDayOnAdjusting,
        boolean animateSunOnAdjusting, boolean animateAMPMOnAdjusting, boolean animateHourOnAdjusting,
        boolean animateMinuteOnAdjusting, boolean animateSecondOnAdjusting)
    {
        this.maximum = maximum;
        this.maximumChangePerSecond = maximumChangePerSecond;
        this.roundToNearest = roundToNearest;
        this.roundOffset = roundOffset;

        tickDistance = maximum / 120;
        lockDistance = maximum / 5760;

        this.animateYearOnAdjusting = animateYearOnAdjusting;
        this.animateMonthOnAdjusting = animateMonthOnAdjusting;
        this.animateDayOnAdjusting = animateDayOnAdjusting;

        this.animateSunOnAdjusting = animateSunOnAdjusting;
        this.animateAMPMOnAdjusting = animateAMPMOnAdjusting;

        this.animateHourOnAdjusting = animateHourOnAdjusting;
        this.animateMinuteOnAdjusting = animateMinuteOnAdjusting;
        this.animateSecondOnAdjusting = animateSecondOnAdjusting;
    }

    public double getMaximum()
    {
        return maximum;
    }

    public double getMaximumChangePerSecond()
    {
        return maximumChangePerSecond;
    }

    public double getRoundToNearest()
    {
        return roundToNearest;
    }

    public double getRoundOffset()
    {
        return roundOffset;
    }

    public double getTickDistance()
    {
        return tickDistance;
    }

    public double getLockDistance()
    {
        return lockDistance;
    }

    public boolean isAnimateYearOnAdjusting()
    {
        return animateYearOnAdjusting;
    }

    public boolean isAnimateMonthOnAdjusting()
    {
        return animateMonthOnAdjusting;
    }

    public boolean isAnimateDayOnAdjusting()
    {
        return animateDayOnAdjusting;
    }

    public boolean isAnimateSunOnAdjusting()
    {
        return animateSunOnAdjusting;
    }

    public boolean isAnimateAMPMOnAdjusting()
    {
        return animateAMPMOnAdjusting;
    }

    public boolean isAnimateHourOnAdjusting()
    {
        return animateHourOnAdjusting;
    }

    public boolean isAnimateMinuteOnAdjusting()
    {
        return animateMinuteOnAdjusting;
    }

    public boolean isAnimateSecondOnAdjusting()
    {
        return animateSecondOnAdjusting;
    }

}
